<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
        <title>Consultar Evento</title>
        <script src="../midia/scripts/mascaras.js"></script>
    </h:head>     
    <h:body>
        <ui:include src="../layout/menu.xhtml" />
        <div id="corpo">
            <f:view>
                <h:form>
                    <fieldset>
                        <legend>Inserir evento</legend>
                        <table>
                            <tr>
                                <td>Descrição:</td>
                                <td><h:inputText size="76" value="#{eventoBean.evento.descricao}"  required="true" requiredMessage="Preencha o campo Descrição!"></h:inputText></td>
                            </tr>                           
                           <tr>
                            	<td>Data:</td>                            	
                            	<td><h:inputText size="10" onkeypress="mascara(this, Data)" maxlength="10" value="#{eventoBean.evento.data}" required="true" requiredMessage="Preencha o campo Data!" type="date"></h:inputText></td>                            	
                            </tr>
                            
                             
                            <tr>
                            	<td>Hora:</td>                            	
                            	<td><h:inputText size="10" onkeypress="mascara(this, Hora)" maxlength="5" value="#{eventoBean.evento.hora}" required="true" requiredMessage="Preencha o campo Hora!"></h:inputText></td>                            	
                            </tr>
                            <tr>
                            	<td>Produtora:</td>
                            	<td>
                            		<h:selectOneListbox value="#{eventoBean.produtora}">											
	                            		 <f:selectItems  value="#{eventoBean.listaProdutora}" var="prod" 
                                                                 itemLabel="#{prod.nome}" itemValue="#{prod.codigoProdutora}"/>		                            		 
	                            	</h:selectOneListbox>
								</td>   
							</tr>
								
							<tr>
								<td>Artistas</td>
								<td>
									<h:selectManyMenu value="#{eventoBean.artistasSelecionados}" MULTIPLE="true">											
	                            		 <f:selectItems  value="#{eventoBean.listaArtista}" var="art" 
	                            		     itemLabel="#{art.nome}" itemValue="#{art.codigo}"/>		                            		 
	                            	</h:selectManyMenu>(Segure Crtl para selecionar vários)	                            	
								</td>
							</tr>	                        	
                            <tr>
                            	<td>Local</td>
                            	<td>
									<h:selectOneListbox value="#{eventoBean.local}">											
	                            		 <f:selectItems  value="#{eventoBean.listaLocal}" var="loc" 
	                            		     itemLabel="#{loc.descricao}" itemValue="#{loc.codigo}"/>		                            		 
	                            	</h:selectOneListbox>
								</td>
                            </tr>                           
                            <tr>
                                <td>
                                    <h:commandButton value="Inserir" action="#{eventoBean.inserir}"></h:commandButton>  
                                </td>
                            </tr>
                        </table>
                        <h:outputText escape="false" value="#{eventoBean.retornoHtml}" />
                    </fieldset>
                </h:form>                
            </f:view>
        </div>
        <ui:include src="../layout/rodape.xhtml" />
    </h:body>
</html>